<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->

<!-- Mirrored from minetest.gitlab.io/minetest/mods/ by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 01 Oct 2020 14:46:27 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  
  
  <link rel="shortcut icon" href="../img/favicon.ico">
  <title>Mods - Minetest API Documentation</title>
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />

  <link rel="stylesheet" href="../css/theme.css" />
  <link rel="stylesheet" href="../css/theme_extra.css" />
  <link href="../css/code_styles.css" rel="stylesheet" />
  <link href="../css/extra.css" rel="stylesheet" />
  
  <script>
    // Current page data
    var mkdocs_page_name = "Mods";
    var mkdocs_page_input_path = "mods.md";
    var mkdocs_page_url = null;
  </script>
  
  <script src="../js/jquery-2.1.1.min.js" defer></script>
  <script src="../js/modernizr-2.8.3.min.js" defer></script> 
  
</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
    <div class="wy-side-scroll">
      <div class="wy-side-nav-search">
        <a href="../index.html" class="icon icon-home"> Minetest API Documentation</a>
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="http://minetest.gitlab.io/minetest/search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../index.html">Home</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../games/index.html">Games</a>
                    </li>
                </ul>
                <ul class="current">
                    <li class="toctree-l1 current"><a class="reference internal current" href="index.html">Mods</a>
    <ul class="current">
    <li class="toctree-l2"><a class="reference internal" href="#mod-load-path">Mod load path</a>
    </li>
    <li class="toctree-l2"><a class="reference internal" href="#world-specific-games">World-specific games</a>
    </li>
    <li class="toctree-l2"><a class="reference internal" href="#modpacks">Modpacks</a>
    </li>
    <li class="toctree-l2"><a class="reference internal" href="#mod-directory-structure">Mod directory structure</a>
        <ul>
    <li class="toctree-l3"><a class="reference internal" href="#modname">modname</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#modconf">mod.conf</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#screenshotpng">screenshot.png</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#dependstxt">depends.txt</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#descriptiontxt">description.txt</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#settingtypestxt">settingtypes.txt</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#initlua">init.lua</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#textures-sounds-media-models-locale">textures, sounds, media, models, locale</a>
    </li>
        </ul>
    </li>
    <li class="toctree-l2"><a class="reference internal" href="#naming-conventions">Naming conventions</a>
        <ul>
    <li class="toctree-l3"><a class="reference internal" href="#example">Example</a>
    </li>
        </ul>
    </li>
    </ul>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../aliases/index.html">Aliases</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../textures/index.html">Textures</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../sounds/index.html">Sounds</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../registered-definitions/index.html">Registered definitions</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../nodes/index.html">Nodes</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../map-terminology-and-coordinates/index.html">Map terminology and coordinates</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../hud/index.html">HUD</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../representations-of-simple-things/index.html">Representations of simple things</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../flag-specifier-format/index.html">Flag Specifier Format</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../items/index.html">Items</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../groups/index.html">Groups</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Tools</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../entity-damage-mechanism/index.html">Entity damage mechanism</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../metadata/index.html">Metadata</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../formspec/index.html">Formspec</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../inventory/index.html">Inventory</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../colors/index.html">Colors</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../escape-sequences/index.html">Escape sequences</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../spatial-vectors/index.html">Spatial Vectors</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../helper-functions/index.html">Helper functions</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../perlin-noise/index.html">Perlin noise</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../ores/index.html">Ores</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../decoration-types/index.html">Decoration types</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../schematics/index.html">Schematics</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../lua-voxel-manipulator/index.html">Lua Voxel Manipulator</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../mapgen-objects/index.html">Mapgen objects</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../registered-entities/index.html">Registered entities</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../l-system-trees/index.html">L-system trees</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../minetest-namespace-reference/index.html">'minetest' namespace reference</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../class-reference/index.html">Class reference</a>
                    </li>
                </ul>
                <ul>
                    <li class="toctree-l1"><a class="reference internal" href="../definition-tables/index.html">Definition tables</a>
                    </li>
                </ul>
      </div>
    </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../index.html">Minetest API Documentation</a>
      </nav>

      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../index.html">Docs</a> &raquo;</li>
    
      
    
    <li>Mods</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
  </ul>
  
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
                <h1 id="mods">Mods<a class="headerlink" href="#mods" title="Permanent link">&para;</a></h1>
<h2 id="mod-load-path">Mod load path<a class="headerlink" href="#mod-load-path" title="Permanent link">&para;</a></h2>
<p>Paths are relative to the directories listed in the [Paths] section above.</p>
<ul>
<li><code>games/&lt;gameid&gt;/mods/</code></li>
<li><code>mods/</code></li>
<li><code>worlds/&lt;worldname&gt;/worldmods/</code></li>
</ul>
<h2 id="world-specific-games">World-specific games<a class="headerlink" href="#world-specific-games" title="Permanent link">&para;</a></h2>
<p>It is possible to include a game in a world; in this case, no mods or
games are loaded or checked from anywhere else.</p>
<p>This is useful for e.g. adventure worlds and happens if the <code>&lt;worldname&gt;/game/</code>
directory exists.</p>
<p>Mods should then be placed in <code>&lt;worldname&gt;/game/mods/</code>.</p>
<h2 id="modpacks">Modpacks<a class="headerlink" href="#modpacks" title="Permanent link">&para;</a></h2>
<p>Mods can be put in a subdirectory, if the parent directory, which otherwise
should be a mod, contains a file named <code>modpack.conf</code>.
The file is a key-value store of modpack details.</p>
<ul>
<li><code>name</code>: The modpack name. Allows Minetest to determine the modpack name even
          if the folder is wrongly named.</li>
<li><code>description</code>: Description of mod to be shown in the Mods tab of the main
                 menu.</li>
<li><code>author</code>: The author of the modpack. It only appears when downloaded from
            ContentDB.</li>
<li><code>release</code>: Ignore this: Should only ever be set by ContentDB, as it is an
             internal ID used to track versions.</li>
<li><code>title</code>: A human-readable title to address the modpack.</li>
</ul>
<p>Note: to support 0.4.x, please also create an empty modpack.txt file.</p>
<h2 id="mod-directory-structure">Mod directory structure<a class="headerlink" href="#mod-directory-structure" title="Permanent link">&para;</a></h2>
<div class="codehilite"><pre><span></span><code><span class="err">mods</span>
<span class="err">├── modname</span>
<span class="err">│   ├── mod.conf</span>
<span class="err">│   ├── screenshot.png</span>
<span class="err">│   ├── settingtypes.txt</span>
<span class="err">│   ├── init.lua</span>
<span class="err">│   ├── models</span>
<span class="err">│   ├── textures</span>
<span class="err">│   │   ├── modname_stuff.png</span>
<span class="err">│   │   ├── modname_stuff_normal.png</span>
<span class="err">│   │   ├── modname_something_else.png</span>
<span class="err">│   │   ├── subfolder_foo</span>
<span class="err">│   │   │   ├── modname_more_stuff.png</span>
<span class="err">│   │   │   └── another_subfolder</span>
<span class="err">│   │   └── bar_subfolder</span>
<span class="err">│   ├── sounds</span>
<span class="err">│   ├── media</span>
<span class="err">│   ├── locale</span>
<span class="err">│   └── &lt;custom data&gt;</span>
<span class="err">└── another</span>
</code></pre></div>

<h3 id="modname">modname<a class="headerlink" href="#modname" title="Permanent link">&para;</a></h3>
<p>The location of this directory can be fetched by using
<code>minetest.get_modpath(modname)</code>.</p>
<h3 id="modconf">mod.conf<a class="headerlink" href="#modconf" title="Permanent link">&para;</a></h3>
<p>A <code>Settings</code> file that provides meta information about the mod.</p>
<ul>
<li><code>name</code>: The mod name. Allows Minetest to determine the mod name even if the
          folder is wrongly named.</li>
<li><code>description</code>: Description of mod to be shown in the Mods tab of the main
                 menu.</li>
<li><code>depends</code>: A comma separated list of dependencies. These are mods that must be
             loaded before this mod.</li>
<li><code>optional_depends</code>: A comma separated list of optional dependencies.
                      Like a dependency, but no error if the mod doesn't exist.</li>
<li><code>author</code>: The author of the mod. It only appears when downloaded from
            ContentDB.</li>
<li><code>release</code>: Ignore this: Should only ever be set by ContentDB, as it is an
             internal ID used to track versions.</li>
<li><code>title</code>: A human-readable title to address the mod.</li>
</ul>
<p>Note: to support 0.4.x, please also provide depends.txt.</p>
<h3 id="screenshotpng"><code>screenshot.png</code><a class="headerlink" href="#screenshotpng" title="Permanent link">&para;</a></h3>
<p>A screenshot shown in the mod manager within the main menu. It should
have an aspect ratio of 3:2 and a minimum size of 300×200 pixels.</p>
<h3 id="dependstxt"><code>depends.txt</code><a class="headerlink" href="#dependstxt" title="Permanent link">&para;</a></h3>
<p><strong>Deprecated:</strong> you should use mod.conf instead.</p>
<p>This file is used if there are no dependencies in mod.conf.</p>
<p>List of mods that have to be loaded before loading this mod.</p>
<p>A single line contains a single modname.</p>
<p>Optional dependencies can be defined by appending a question mark
to a single modname. This means that if the specified mod
is missing, it does not prevent this mod from being loaded.</p>
<h3 id="descriptiontxt"><code>description.txt</code><a class="headerlink" href="#descriptiontxt" title="Permanent link">&para;</a></h3>
<p><strong>Deprecated:</strong> you should use mod.conf instead.</p>
<p>This file is used if there is no description in mod.conf.</p>
<p>A file containing a description to be shown in the Mods tab of the main menu.</p>
<h3 id="settingtypestxt"><code>settingtypes.txt</code><a class="headerlink" href="#settingtypestxt" title="Permanent link">&para;</a></h3>
<p>The format is documented in <code>builtin/settingtypes.txt</code>.
It is parsed by the main menu settings dialogue to list mod-specific
settings in the "Mods" category.</p>
<h3 id="initlua"><code>init.lua</code><a class="headerlink" href="#initlua" title="Permanent link">&para;</a></h3>
<p>The main Lua script. Running this script should register everything it
wants to register. Subsequent execution depends on minetest calling the
registered callbacks.</p>
<p><code>minetest.settings</code> can be used to read custom or existing settings at load
time, if necessary. (See [<code>Settings</code>])</p>
<h3 id="textures-sounds-media-models-locale"><code>textures</code>, <code>sounds</code>, <code>media</code>, <code>models</code>, <code>locale</code><a class="headerlink" href="#textures-sounds-media-models-locale" title="Permanent link">&para;</a></h3>
<p>Media files (textures, sounds, whatever) that will be transferred to the
client and will be available for use by the mod and translation files for
the clients (see [Translations]).</p>
<p>It is suggested to use the folders for the purpous they are thought for,
eg. put textures into <code>textures</code>, translation files into <code>locale</code>,
models for entities or meshnodes into <code>models</code> et cetera.</p>
<p>These folders and subfolders can contain subfolders.
Subfolders with names starting with <code>_</code> or <code>.</code> are ignored.
If a subfolder contains a media file with the same name as a media file
in one of its parents, the parent's file is used.</p>
<h2 id="naming-conventions">Naming conventions<a class="headerlink" href="#naming-conventions" title="Permanent link">&para;</a></h2>
<p>Registered names should generally be in this format:</p>
<div class="codehilite"><pre><span></span><code><span class="c">modname:&lt;whatever&gt;</span>
</code></pre></div>

<p><code>&lt;whatever&gt;</code> can have these characters:</p>
<div class="codehilite"><pre><span></span><code><span class="err">a-zA-Z0-9_</span>
</code></pre></div>

<p>This is to prevent conflicting names from corrupting maps and is
enforced by the mod loader.</p>
<p>Registered names can be overridden by prefixing the name with <code>:</code>. This can
be used for overriding the registrations of some other mod.</p>
<p>The <code>:</code> prefix can also be used for maintaining backwards compatibility.</p>
<h3 id="example">Example<a class="headerlink" href="#example" title="Permanent link">&para;</a></h3>
<p>In the mod <code>experimental</code>, there is the ideal item/node/entity name <code>tnt</code>.
So the name should be <code>experimental:tnt</code>.</p>
<p>Any mod can redefine <code>experimental:tnt</code> by using the name</p>
<div class="codehilite"><pre><span></span><code><span class="err">:experimental:tnt</span>
</code></pre></div>

<p>when registering it. That mod is required to have <code>experimental</code> as a
dependency.</p>
              
            </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../aliases/index.html" class="btn btn-neutral float-right" title="Aliases">Next <span class="icon icon-circle-arrow-right"></span></a>
      
      
        <a href="../games/index.html" class="btn btn-neutral" title="Games"><span class="icon icon-circle-arrow-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
  </div>

  Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org/">Read the Docs</a>.
</footer>
      
        </div>
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
      
        <span><a href="../games/index.html" style="color: #fcfcfc;">&laquo; Previous</a></span>
      
      
        <span style="margin-left: 15px"><a href="../aliases/index.html" style="color: #fcfcfc">Next &raquo;</a></span>
      
    </span>
</div>
    <script>var base_url = '../index.html';</script>
    <script src="../js/theme.js" defer></script>
      <script src="../search/main.js" defer></script>
    <script defer>
        window.onload = function () {
            SphinxRtdTheme.Navigation.enable(true);
        };
    </script>

</body>

<!-- Mirrored from minetest.gitlab.io/minetest/mods/ by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 01 Oct 2020 14:46:27 GMT -->
</html>
